/*
 * 账号管理接口
 */
import axios from '@/utils/request'

const baseUrl = '/sys/account'
// 分页查询
export function findByConditions(params) {
  return axios.request({
    url: `${baseUrl}/findByConditions`,
    method: 'get',
    params: params
  })
}
// 按id查询
export function findById(params) {
  return axios.request({
    url: `${baseUrl}/findById`,
    method: 'GET',
    params: params
  })
}
// 按userId查询
export function findByUserId(params) {
  return axios.request({
    url: `${baseUrl}/findByUserId`,
    method: 'GET',
    params: params
  })
}
// 创建
export function create(params) {
  return axios.request({
    url: `${baseUrl}/`,
    method: 'POST',
    data: params
  })
}
// 更新
export function update(params) {
  return axios.request({
    url: `${baseUrl}/`,
    method: 'PUT',
    data: params
  })
}
// 按id显示角色绑定视图
export function showBindRoleView(params) {
  return axios.request({
    url: `${baseUrl}/showBindRoleView`,
    method: 'GET',
    params: params
  })
}
// 绑定应用
export function bindApplication(params) {
  return axios.request({
    url: `${baseUrl}/batchBindApplication`,
    method: 'POST',
    data: params
  })
}
// 绑定角色
export function batchBindRole(params) {
  return axios.request({
    url: `${baseUrl}/batchBindRole`,
    method: 'POST',
    data: params
  })
}
